<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <title>基础信息</title>
    <script src="/lib/jquery/jquery.min.js"></script>
    <script src="/lib/bootstrap/js/bootstrap.min.js"></script>
    <script src="/layer/layer.js"></script>
    <script src="/lib/plugin/jquery.tools.plugins.js"></script>
    <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css"  />
    <link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css"  />
</head>
<body style="overflow: hidden;">
<div class="row">
    <div class="col-lg-12" >
        <div style="margin-top: 5px;">
            <ol class="breadcrumb">
                <li><a href="#">主页</a></li>
                <li><a href="/oss/information">基本信息</a></li>
            </ol>
        </div>
    </div>
    <div class="col-lg-12">
        <div class="panel panel-default">
            <div class="panel-heading">oss-server基础信息</div>
            <div class="panel-body">
                <form class="form-horizontal adminex-form"id="baseForm">
                    <input type="hidden" name="id" value="${ossInfo.id}"/>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label">存储路径</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="root" value="${ossInfo.root}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label">素材下载根目录</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="invokingRoot" value="${ossInfo.invokingRoot}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label">nginx日志路径</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control tooltips" name="nginxLogPath" value="${ossInfo.nginxLogPath}">
                            <span class="help-block">oss-server根据nginx的access.log获取活跃文件信息,一般存储路径为<code>/usr/local/nginx/logs/access.log</code></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-4 col-sm-offset-2">
                            <button class="btn btn-primary" type="button" id="btnSave"><i class="fa fa-save" aria-hidden="true"></i> 保存内容</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function () {
        $("#btnSave").on("click",function (e) {
            e.preventDefault();
            var data=$("#baseForm").json();
            if(!data.root){
                layer.msg("存储路径不能为空");
                return false;
            }
            if(!data.invokingRoot){
                layer.msg("素材下载根目录不能为空");
                return false;
            }
            $.post("/oss/sys/mergeInformation",data,function (d) {
                $.handle(d,function (data) {
                    layer.msg("保存成功");
                    $("input[name=id]").val(data);
                })
            })
        })
    })
</script>

</body>
</html>